package org.raycloud.commons;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Created by Administrator on 2014/4/1.
 * Time: 15:01
 */
public class Tools {
    //取字符串中的数字
    public static int getNumbers(String content) {
        Pattern pattern = Pattern.compile("\\d+");
        Matcher matcher = pattern.matcher(content);
        while (matcher.find()) {
            int num= Integer.parseInt(matcher.group(0));
//            System.out.println(num);
            return num;
        }

        return 0;
    }
   
}
